package com.example.day5;


/**
 * @author zjianfa
 */
public class Queue implements CommonCollection,QueueInterface{
    private List list;

    public Queue(int size) {
        this.list = new List();
    }

    @Override
    public int getSize() {
        return list.getSize();
    }

    @Override
    public boolean isEmpty() {
        return list.isEmpty();
    }

    @Override
    public boolean isContain(int number) {
        return list.isContain(number);
    }

    @Override
    public int[] toArray() {
        return list.toArray();
    }

    @Override
    public void clear() {
        list.clear();
    }

    @Override
    public String toStr() {
        return list.toStr();
    }

    @Override
    public void offer(int number) {
        list.add(number);
    }

    @Override
    public int poll() {
        int result = list.getFirst();
        list.removeFirst();
        return  result;
    }


    @Override
    public int peek() {
        return list.getFirst();
    }
}
